import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopExpressController } from '../../../controllers';
const uctoominishopExpressRouter = new Router();
const minishopExpressController = new uctooMinishopExpressController();

uctoominishopExpressRouter.post('/add', requireUser, minishopExpressController.add);
uctoominishopExpressRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_express'), minishopExpressController.edit);
uctoominishopExpressRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_express'), minishopExpressController.delete);

//For getting minishopExpress with permission control
uctoominishopExpressRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_express'), minishopExpressController.getSingle);
uctoominishopExpressRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_express'), minishopExpressController.getMany);
uctoominishopExpressRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_express'), minishopExpressController.getMany);

//#endregion AutoCreateCode
export default uctoominishopExpressRouter;
